package com.shijie.newvideo;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;

import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

public class PlayDownActivity extends BaseActivity {
    RecyclerView rv_video;
    Context mContext;
    DownListAdapter vodDetailListAdapter;
    List<IdNameBean> videoList = new ArrayList<>();


    public static void intentTo(Context context, List<IdNameBean> videoList) {
        Intent intent = new Intent(context, PlayDownActivity.class);
        Bundle bundle = new Bundle();
        bundle.putSerializable("videoList", (Serializable) videoList);
        intent.putExtras(bundle);
        context.startActivity(intent);
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_play_detail_down);
        videoList = (List<IdNameBean>) getIntent().getSerializableExtra("videoList");
        mContext = this;

        rv_video = findViewById(R.id.rv_video);
        rv_video.setLayoutManager(new LinearLayoutManager(mContext, LinearLayoutManager.VERTICAL, false));
        vodDetailListAdapter = new DownListAdapter(mContext, videoList);
        rv_video.setAdapter(vodDetailListAdapter);

        // 启动下载任务

        // 监听下载进度

    }


}

